/**
 * 
 */
package hr.fer.zemris.rznu.model.factories;

import hr.fer.zemris.rznu.model.authorization.UserInRole;
import hr.fer.zemris.rznu.model.betting.BettingEvent;
import hr.fer.zemris.rznu.model.betting.BettingSlip;
import hr.fer.zemris.rznu.model.dto.authorization.UserInRoleDTO;
import hr.fer.zemris.rznu.model.dto.betting.BettingEventDTO;
import hr.fer.zemris.rznu.model.dto.betting.BettingSlipDTO;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Dajan
 *
 */
public class ConverterFromDTOFactory {

	public static Set<UserInRole> getUsersInRole(Set<UserInRoleDTO> usersInRoleDTO){
		
		Set<UserInRole> usersInRole = new HashSet<UserInRole>();
		
		for(UserInRoleDTO userInRoleDTO : usersInRoleDTO){
			usersInRole.add(new UserInRole(userInRoleDTO));
		}
		
		return usersInRole;
		
	}
	
	public static Set<BettingEvent> getBettingEvents(Set<BettingEventDTO> bettingEventsDTO){
		
		Set<BettingEvent> bettingEvents = new HashSet<BettingEvent>();
		
		for(BettingEventDTO bettingEventDTO : bettingEventsDTO){
			
			bettingEvents.add(new BettingEvent(bettingEventDTO));
			
		}
		
		return bettingEvents;
		
	}
	
	public static Set<BettingSlip> getBettingSlips(Set<BettingSlipDTO> bettingSlipsDTO){
		
		Set<BettingSlip> bettingSlips = new HashSet<BettingSlip>();
		
		for(BettingSlipDTO bettingSlipDTO : bettingSlipsDTO){
			
			bettingSlips.add(new BettingSlip(bettingSlipDTO));
			
		}
		
		return bettingSlips;
		
	}

}
